/* style.css */
:root {
    --bg: #232333;
    --surface: #2a2a3a;
    --sidebar: #232333;
    --primary: #7aa2f7;
    --primary-hover: #8aadff;
    --stop: #f7768e;
    --stop-hover: #ff869d;
    --text: #c0caf5;
    --error: #f7768e;
    --warning: #e0af68;
    --success: #9ece6a;
    --modal-bg: rgba(0, 0, 0, 0.7);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0px); }
}

body {
    font-family: 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    user-select: none;
    overflow-x: hidden;
}

.logo-header {
    text-align: center;
    padding: 15px;
    background: var(--bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    animation: fadeIn 0.5s ease-out;
}

.logo-img {
    height: 40px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: rotate(-5deg) scale(1.1);
}

.app-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    animation: fadeIn 0.8s ease-out;
    background: var(--bg);
}

@media (min-width: 768px) {
    .app-container {
        flex-direction: row;
    }
    
    .logo-header {
        display: none;
    }
}

.sidebar {
    width: 100%;
    background: var(--bg);
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    animation: slideIn 0.5s ease-out;
}

@media (min-width: 768px) {
    .sidebar {
        width: 280px;
        height: 100vh;
        position: sticky;
        top: 0;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        border-bottom: none;
        overflow-y: auto;
    }
}

.sidebar.collapsed {
    transform: translateX(-100%);
    width: 0;
    padding: 0;
    border: none;
}

.account-list {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    padding-bottom: 0.8rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--surface);
}

.account-list::-webkit-scrollbar {
    height: 6px;
}

.account-list::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 3px;
}

@media (min-width: 768px) {
    .account-list {
        display: block;
        overflow-x: hidden;
    }
}

.account-item {
    min-width: 200px;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    flex-shrink: 0;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: fadeIn 0.4s ease-out;
    animation-fill-mode: backwards;
}

.account-item:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.account-item.active {
    background: var(--primary);
    color: #1a1a2e;
    box-shadow: 0 0 0 2px var(--primary-hover);
}

.account-item:nth-child(1) { animation-delay: 0.1s; }
.account-item:nth-child(2) { animation-delay: 0.2s; }
.account-item:nth-child(3) { animation-delay: 0.3s; }

.account-status {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: var(--transition);
}

.status-running {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulse 2s infinite;
}

.status-stopped {
    background: var(--error);
    box-shadow: 0 0 10px var(--error);
}

.account-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.account-btn {
    flex: 1;
    padding: 0.4rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.account-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.account-btn:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.account-btn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

.start-btn {
    background: var(--success);
    color: white;
}

.stop-btn {
    background: var(--error);
    color: white;
}

.delete-btn {
    background: #ff5555;
    color: white;
}

.main-content {
    flex: 1;
    padding: 1.5rem;
    max-width: 100%;
    overflow-y: auto;
    animation: fadeIn 0.7s ease-out;
    background: var(--bg);
}

@media (min-width: 768px) {
    .main-content {
        width: calc(100% - 280px);
    }
    
    .main-content.full-width {
        width: 100%;
    }
}

.container {
    background: var(--surface);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    max-width: 800px;
    margin: 0 auto 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
    animation: fadeIn 0.6s ease-out;
}

.container:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

.panel-header {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-bottom: 1.8rem;
    animation: fadeIn 0.5s ease-out;
}

@media (min-width: 768px) {
    .panel-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.panel-title {
    font-size: 1.5rem;
    color: var(--primary);
    margin: 0;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(122, 162, 247, 0.3);
}

.new-panel-btn, .submit-btn, .modal-btn {
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.new-panel-btn {
    background: var(--primary);
    color: #1a1a2e;
    padding: 0.7rem 1.2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: float 3s ease-in-out infinite;
}

.new-panel-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.submit-btn {
    background: var(--primary);
    color: #1a1a2e;
    padding: 0.9rem;
    width: 100%;
    margin-top: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: pulse 2s infinite;
}

.submit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.alert {
    background: rgba(240, 118, 142, 0.1);
    border-left: 4px solid var(--error);
    padding: 1rem;
    margin-bottom: 1.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    animation: fadeIn 0.6s ease-out;
    backdrop-filter: blur(5px);
}

.form-group {
    margin-bottom: 1.5rem;
    animation: fadeIn 0.5s ease-out;
}

label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
}

input, textarea {
    width: 100%;
    padding: 0.9rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    backdrop-filter: blur(5px);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(122, 162, 247, 0.3);
    transform: translateY(-1px);
}

textarea {
    min-height: 140px;
    resize: vertical;
}

.results {
    margin-top: 1.8rem;
    border-radius: 8px;
    overflow: hidden;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.1);
    padding: 0.8rem;
    font-size: 0.9rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
    animation: fadeIn 0.7s ease-out;
}

.results::-webkit-scrollbar {
    width: 6px;
}

.results::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 3px;
}

.result-item {
    padding: 0.9rem 1rem;
    margin-bottom: 0.6rem;
    border-radius: 6px;
    font-size: 0.9rem;
    word-break: break-word;
    animation: fadeIn 0.4s ease-out;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.success {
    background: rgba(158, 206, 106, 0.1);
    color: var(--success);
    border-left: 3px solid var(--success);
}

.error {
    background: rgba(247, 118, 142, 0.1);
    color: var(--error);
    border-left: 3px solid var(--error);
}

.warning {
    background: rgba(224, 175, 104, 0.1);
    color: var(--warning);
    border-left: 3px solid var(--warning);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-bg);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    text-align: center;
    animation: fadeIn 0.4s ease-out, slideIn 0.4s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 1.2rem;
    font-weight: 700;
}

.modal-message {
    margin-bottom: 1.8rem;
    font-size: 1rem;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-btn {
    padding: 0.7rem 1.2rem;
    flex: 1;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-confirm {
    background: var(--error);
    color: white;
}

.modal-confirm:hover {
    background: var(--stop-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.modal-cancel {
    background: var(--primary);
    color: #1a1a2e;
}

.modal-cancel:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-toggle {
    display: none;
    background: var(--primary);
    color: #1a1a2e;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0.5rem;
    margin: 0.5rem;
    cursor: pointer;
    font-weight: bold;
    position: fixed;
    z-index: 1001;
    top: 70px;
    left: 10px;
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: pulse 2s infinite;
}

.sidebar-toggle:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

@media (max-width: 767px) {
    .sidebar-toggle {
        display: block;
    }
}

input, textarea, select {
    font-size: 16px !important;
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
    }
    
    .panel-header {
        flex-direction: column;
    }
    
    .new-panel-btn {
        width: 100%;
    }
}

.account-item.active, .submit-btn {
    box-shadow: 0 0 15px rgba(122, 162, 247, 0.5);
}